<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
    <title>图书增加</title>
	<base href="<%=basePath%>">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	<style type="text/css">
		#preview{width:100px;height:100px;border:1px solid #000;overflow:hidden;}
		#imghead {filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=image);}
	</style>
	<script type="text/javascript" src="js/upload.js"></script> 
	<script type="text/javascript" src="js/jquery-1.9.1.js"></script>
	<link rel="stylesheet" type="text/css" href="js/uploadify.css" >
	<script type="text/javascript" src="js/jquery.uploadify.js"></script>
	<script >
		$(function() {
		    $("#file_upload").uploadify({
		    	
		    	'fileSizeLimit' : '5MB',
		    	'fileObjName' : 'file_upload',
		    	'fileTypeDesc' : 'bhb',
		    	'fileTypeExts' : '*.gif; *.jpg; *.png',
		    	'buttonText'    : '选择文件',
		        'swf'      : 'js/uploadify.swf',
		        'uploader' : 'user/uploadAction',
		         'folder'  : 'attached',
		        'displayData'    : 'speed',
		        'onUploadSuccess' : function(file, data, response) {
		        
            		alert('The file ' + file.name + ' was successfully uploaded with a response of ' + response + ':' + data);
        		}
		    });
		});
	</script>
</head>

<body >
<div id="preview">
		<img id="imghead" width=100 height=100 border=0 src='images/00001.png'>
</div>
<input type="file" name="file_upload" id="file_upload" /><a href="javascript:$('#file_upload').uploadify('upload','*')">上传</a>
</body>
</html>
